﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace dodone
{
    /// <summary>
    /// Interaction logic for CalendarPopup.xaml
    /// </summary>
    public partial class CalendarPopupMenu : UserControl
    {
        public CalendarPopupMenu()
        {
            InitializeComponent();
        }

        private void btnFinish_Click(object sender, RoutedEventArgs e)
        {
            if (txtTitle.Text != "")
                monthItem.Content = txtTitle.Text;

            Popup parent = this.Parent as Popup;
            parent.IsOpen = false;
            this.Clear_Content();
        }

        private ListBoxItem monthItem;
        public void Bind_Item(ListBoxItem item)
        {
            monthItem = item;
            txtTitle.Text = item.Content as String;
        }

        public void Clear_Content()
        {
            txtTitle.Text = "";
        }

    }
}
